﻿using System.Collections.Generic;

namespace TWS.Cart.Business
{
	public class ProdAttribute
	{
		public ProdAttribute(long Id, string Type, string Value)
		{
			this.Id = Id;
			this.Type = Type;
			this.Value = Value;
		}

		public long Id { get; set; }
		public string Type { get; set; }
		public string Value { get; set; }
	}
    /// <summary>
    /// Summary description for CartItem
    /// </summary>
    public class CartItem
    {
        public CartItem()
        { }
		public CartItem(int Id, string ImagePath, string Name, string SKU, int Quantity, decimal UnitPrice, List<ProdAttribute> AdditionalAttributes)
        {
            this.Id = Id;
            this.ImagePath = ImagePath;
            this.Name = Name;
            this.SKU = SKU;
            this.Quantity = Quantity;
            this.AdditionalAttributes = AdditionalAttributes;
            this.UnitPrice = UnitPrice;
        }

        public CartItem(int Id, string ImagePath, string Name, string SKU, int Quantity, decimal UnitPrice)
        {
            this.Id = Id;
            this.ImagePath = ImagePath;
            this.Name = Name;
            this.SKU = SKU;
            this.Quantity = Quantity;
            this.UnitPrice = UnitPrice;
        }

        public int Id { get; set; }
        public string ImagePath { get; set; }
        public string Name { get; set; }
        public string SKU { get; set; }
        public int Quantity { get; set; }
        public decimal UnitPrice { get; set; }
		/// <summary>
		/// The Quantity times the UnitPrice
		/// </summary>
        public decimal SubTotal
        {
            get { return Quantity*UnitPrice; }
        }
		List<ProdAttribute> _additionalAttributes = new List<ProdAttribute>();
		public List<ProdAttribute> AdditionalAttributes
        {
            get { return _additionalAttributes; }
            set { _additionalAttributes = value; }
        }
    }
}
